import request from '@/utils/request'

// 核心指标-销售开单
export function getSaleCoreQuantity(date) {
  return request(
    {
      url: '/app/v1/sale/core/billing-quantity',
      method: 'get',
      params: { date }
    }
  )
}

// 核心指标-办事处销售开单
export function getSaleOfficeCoreQuantity({ date, officeName }) {
  return request(
    {
      url: '/app/v1/sale/office/core/billing-quantity',
      method: 'get',
      params: { date, officeName }
    }
  )
}

// 核心指标-VSO
export function getSaleCoreVsoQuantity(date) {
  return request(
    {
      url: '/app/v1/sale/core/vso-quantity',
      method: 'get',
      params: { date }
    }
  )
}
// 核心指标-办事处VSO
export function getSaleOfficeCoreVsoQuantity({ date, officeName }) {
  return request(
    {
      url: '/app/v1/sale/office/core/vso-quantity',
      method: 'get',
      params: { date, officeName }
    }
  )
}

// 销售开单近6月趋势
export function getSaleOrderSixMonth() {
  return request(
    {
      url: '/app/v1/sale/order/trend/6month',
      method: 'get'
    }
  )
}

// 销售地图-办事处月销售量
export function getSaleOrderOfficeMap() {
  return request(
    {
      url: '/app/v1/sale/order/month/office',
      method: 'get'
    }
  )
}

// 各部门（办事处及其他部门）销售开单（车）
export function getSaleOrderOffice() {
  return request(
    {
      url: '/app/v1/sale/order/office',
      method: 'get'
    }
  )
}

// 销售开单本年总销量
export function getSaleOrderYearSoQuantity() {
  return request(
    {
      url: '/app/v1/sale/order/year/so-quantity',
      method: 'get'
    }
  )
}

// 办事处销售开单本年总销量
export function getOfficeSaleOrderYearSoQuantity(provinceName) {
  return request(
    {
      url: '/app/v1/sale/order/office/year/so-quantity',
      method: 'get',
      params: { provinceName }
    }
  )
}

// 办事处销售开单近6月趋势
export function getSaleOfficeSixMonth(provinceName) {
  return request(
    {
      url: '/app/v1/sale/order/trend/office/6month',
      method: 'get',
      params: { provinceName }
    }
  )
}

// 销售开单当月趋势
export function getSaleOrderCurMonth() {
  return request(
    {
      url: '/app/v1/sale/order/trend/currentMonth',
      method: 'get'
    }
  )
}

// 办事处销售开单当月趋势
export function getSaleOfficeCurrentMonth(provinceName) {
  return request(
    {
      url: '/app/v1/sale/order/trend/office/currentMonth',
      method: 'get',
      params: { provinceName }
    }
  )
}
// 按类型统计今日，当月销售
export function getSaleOrderTypeDayMonth(date) {
  return request(
    {
      url: '/app/v1/sale/order/type/dayMonth',
      method: 'get',
      params: { date }
    }
  )
}
